<template>
	<view class="box">
		<view class="box1">
			<view class="back">
				<image src="@/static/image/后退.png"></image>
				<view class="back1">购物车</view>
				<view class="back2"><span style="margin-right: 20rpx;">(2)</span> 管理</view>
			</view>

			<view class="login">
				<view class="login1">最快<span style="color: #44b878;">30</span>分钟送达</view>
				<view class="login1"><span style="color: #edb184;">3</span>张可用优惠卷<image
						src="../../static/image/下一项.png"></image>
				</view>
			</view>
			<view class="login2">
				<view class="login2-1">满减优惠</view>
				<view class="login2-2">再买39.9可享 满29.9减10</view>
				<view class="login2-3">去凑单<image src="../../static/image/下一项.png"></image>
				</view>
			</view>
		</view>

		<view class="box2">
			<view class="box2-1" v-for="(item,index) in list" :key="index">
				<view class="box2-top">{{ item.text }}</view>
				<view class="box2-bottom">
					<view class="box2-bottom1">
						<image :src="item.image"></image>
					</view>
					<view class="box2-bottom2">
						<view class="box2-bottom2-top">{{ item.text1 }}</view>
						<view class="box2-bottom2-center">{{ item.text2 }}</view>
						<view class="box2-bottom2-bottom">
							<view>
								<span style="color: #f09b60;font-weight: bold;">{{ item.text3 }}</span>/斤
							</view>
							<view class="">
								<u-icon name="minus-circle-fill" size="44" @click="num1"></u-icon>{{ num }}
								<u-icon name="plus-circle-fill" color="#6ac492" size="44" @click="num2"></u-icon>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="shop">
			<view class="shop-title">猜你喜欢</view>
			<view class="shop-thing" @click="nav">
				<view class="shop-item" v-for="(item,index) in shop" :key="index">
					<view class="shop-item1">
						<image :src="item.img"></image>
					</view>
					<view class="shop-item2">{{ item.text1 }}</view>
					<view class="c1">
						<view class="shop-item3">{{ item.text2 }}</view>
						<view class="shop-item4">{{ item.text3 }}</view>
						<view class="shop-item5">
							<view class="item5-left">{{ item.text4 }}</view>
							<view class="item5-right" v-if="item.text5">{{ item.text5 }}</view>
						</view>
						<view class="shop-item6"><span
								style="color: #ee8d4a;font-size: 28rpx;">{{ item.text6 }}</span>/斤</view>
						<view class="shop-item7"><u-icon name="plus-circle-fill" color="#6ac492" size="52"></u-icon>
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="box3">
			<view class="box3-top">
				<u-radio-group v-model="value">
					<u-radio :label-disabled="false">全选</u-radio>
				</u-radio-group>
			</view>
			<view class="box3-bottom">
				<view>
					<span style="color: #aeaeae;margin-right: 20rpx">配送费￥0</span>
					<span style="font-weight: bolder;">合计</span>
					<span style="color: #ef9455;font-size: 34rpx;">￥17.58</span>
				</view>
				<view class="btn">去结算</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				num: 1,
				list: [{
						id: 1,
						text: "生鲜多人供应商直发",
						image: '../../static/image/包子.png',
						text1: '江苏无锡香菇猪肉包',
						text2: "多汁香嫩",
						text3: "￥8.79"
					},
					{
						id: 2,
						text: "生鲜多人供应商直发",
						image: '../../static/image/包子.png',
						text1: '浙江临海西蓝花',
						text2: "卷减10元",
						text3: "￥4.79"
					},
				],
				shop: [{
						id: 1,
						img: "../../static/image/包子.png",
						text1: "今日疯抢",
						text2: "江苏无锡香菇猪肉包",
						text3: "猪肉肥美 | 鲜甜嫩软 | 多汁美味",
						text4: "多汁香嫩",
						text5: "卷减10元",
						text6: "￥8.79"
					},
					{
						id: 2,
						img: "../../static/image/包子.png",
						text1: "今日疯抢",
						text2: "浙江临海西蓝花",
						text3: "基地直供 | 绿色培植 | 新鲜采摘",
						text4: "绿色新鲜",
						text5: "卷减10元",
						text6: "￥4.79"
					}
				],
			}
		},
		methods: {
			num1() {
				this.num--
				console.log(this.num)
			},
			num2() {
				this.num++
			},
			nav() {
				uni.navigateTo({
					url: '/pages/shop1/shop1'
				})
			}
		}
	}
</script>

<style lang="scss">
	.box {
		background-color: #f5f5f5;

		.box1 {
			background-image: linear-gradient(#cdf1dd, #f5f5f5);
			height: 30vh;
			border-radius: 35rpx 35rpx 0 0;

			.back {
				display: flex;
				padding-top: 5vh;
				margin-bottom: 10rpx;

				image {
					padding-left: 2vh;
					width: 4vh;
					height: 4vh;

				}

				.back1 {
					font-size: 40rpx;
				}

				.back2 {
					line-height: 60rpx;
					font-size: 26rpx;
				}
			}

			.login {
				background-color: #fff;
				width: 90%;
				margin: auto;
				display: flex;
				justify-content: space-between;
				padding: 20rpx 25rpx;
				border-radius: 20rpx;
				margin-bottom: 20rpx;

				.login1 {
					font-size: 30rpx;
					height: 50rpx;
					line-height: 50rpx;
					display: flex;
					justify-content: space-between;

					image {
						width: 3vh;
						height: 3vh;
						margin-top: 5rpx;
					}
				}
			}

			.login2 {
				background-color: #fff;
				width: 90%;
				margin: auto;
				display: flex;
				justify-content: space-between;
				padding: 20rpx 25rpx;
				border-radius: 20rpx;

				.login2-1 {
					font-size: 26rpx;
					height: 50rpx;
					line-height: 50rpx;
					color: red;
					padding: 0 10rpx;
					background-color: #fed5d2;
				}

				.login2-2 {
					font-size: 30rpx;
					height: 50rpx;
					line-height: 50rpx;
				}

				.login2-3 {
					font-size: 30rpx;
					height: 50rpx;
					line-height: 50rpx;
					font-weight: bold;
					display: flex;
					justify-content: space-between;

					image {
						width: 3vh;
						height: 3vh;
						margin-top: 5rpx;
					}
				}
			}
		}

		.box2 {
			width: 90%;
			margin: auto;

			.box2-1 {
				background-color: #fff;
				padding: 20rpx;
				border-radius: 20rpx;
				margin-bottom: 20rpx;

				.box2-top {
					font-weight: bold;
				}

				.box2-bottom {
					margin-top: 10rpx;
					display: flex;
					justify-content: space-between;

					.box2-bottom1 {
						width: 40%;

						image {
							width: 20vh;
							height: 14vh;
						}
					}

					.box2-bottom2 {
						width: 60%;

						.box2-bottom2-top {
							font-weight: bold;
							margin-bottom: 10rpx;
						}

						.box2-bottom2-center {
							border: 1px solid #f09b60;
							color: #f09b60;
							margin-bottom: 20rpx;
							width: 12vh;
							text-align: center;
						}

						.box2-bottom2-bottom {
							display: flex;
							justify-content: space-between;
							color: #b2b2b2;
						}
					}
				}
			}
		}

		.shop {
			width: 90%;
			margin: 30rpx auto;

			.shop-title {
				font-weight: bolder;
				font-size: 28rpx;
				margin-bottom: 30rpx;
				text-align: center;
			}

			.shop-thing {
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;

				.shop-item {
					width: 49%;
					position: relative;
					background-color: #fff;
					border-radius: 20rpx;
					margin-bottom: 30rpx;

					.shop-item1 {
						width: 100%;
						border-radius: 20rpx;
						box-shadow: 0px 5px 5px grey;
						overflow: hidden;

						image {
							width: 100%;
							height: 200rpx;
						}
					}

					.shop-item2 {
						color: #fff;
						background-color: #e8825b;
						position: absolute;
						top: 0;
						padding: 5rpx 10rpx;
						border-radius: 20rpx 0 20rpx 0;
					}

					.c1 {
						width: 90%;
						margin: auto;

						.shop-item3 {
							padding: 20rpx 0;
							font-size: 26rpx;
							font-weight: 600;
						}

						.shop-item4 {
							color: #aeaba8;
							font-size: 20rpx;
							padding-bottom: 20rpx;
						}

						.shop-item5 {
							display: flex;
							margin-bottom: 20rpx;

							.item5-left {
								color: #ee8d4a;
								border: 1px solid #ee8d4a;
								font-size: 17rpx;
								padding: 3rpx 7rpx;
								margin-right: 16rpx;
							}

							.item5-right {
								color: #4fbf7b;
								border: 1px solid #4fbf7b;
								font-size: 17rpx;
								padding: 3rpx 7rpx;
							}
						}

						.shop-item6 {
							color: #aeaba8;
							font-size: 24rpx;
							margin-bottom: 20rpx;
						}

						.shop-item7 {
							position: absolute;
							bottom: 15rpx;
							right: 20rpx;
						}
					}
				}
			}
		}
		
		.box3{
			width: 90%;
			margin: auto;
			background-color: #fff;
			padding: 20rpx 25rpx;
			border-radius: 20rpx;
			display: flex;
			justify-content: space-between;
			.box3-top{
				
			}
			.box3-bottom{
				display: flex;
				line-height: 50rpx;
				.btn{
					width: 130rpx;
					height: 50rpx;
					font-size: 24rpx;
					background-color: #51c886;
					border-radius: 60rpx;
					color: #fff;
					text-align: center;
					margin-left: 10rpx;
				}
			}
		}
	}
</style>